﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System.Text.RegularExpressions;

namespace LandPortMoblieWeb.Controllers
{
    public  class ReportController : Controller
    {
        //
        // GET: /Report/
        /// <summary>
        /// 计划完成汇总表-进口
        /// </summary>
        /// <returns></returns>
        public ActionResult completeIncom()
        {
            var data = new Service.ImportService().GenReportCurrentMonth();  
            ViewBag.data = data;
            return View();
        }
        /// <summary>
        /// 计划完成汇总表-出口
        /// </summary>
        /// <returns></returns>
        public ActionResult completeExport()
        {
            var data = new Service.ExportService().GenReportCurrentMonth();
            ViewBag.data = data;
            return View();
        }

        /// <summary>
        /// 进口汇总表（日）
        /// </summary>
        /// <returns></returns>
        public ActionResult importReport()
        {
            return View();
        }

        public PartialViewResult ImportPartialView() 
        {

            var dt = Request["dt"];
            if (string.IsNullOrEmpty(dt)) {
                dt = DateTime.Now.ToString("yyyy-MM-dd");
            }
            ViewBag.dt = dt;
            var data = new Service.ImportService().GetJKJHHZB(dt);
            ViewBag.data = data;

            return PartialView();
        
        }

        /// <summary>
        /// 出口汇总表（日）
        /// </summary>
        /// <returns></returns>
        public ActionResult exportReport()
        {
            return View();
        }

        public PartialViewResult ExportPartialView() {

            var dt = Request["dt"];
            if (string.IsNullOrEmpty(dt)) {
                dt = DateTime.Now.ToString("yyyy-MM-dd");
            }
            ViewBag.dt = dt;
            var data = new Service.ExportService().GetJKJHHZB(dt);
            ViewBag.data = data;
            return PartialView();
        }

        /// <summary>
        /// 计划完成汇总表(日)
        /// </summary>
        /// <returns></returns>
        public ActionResult completeReport()
        {
            var dt = Request["dt"];
            if (string.IsNullOrEmpty(dt))
            {
                dt = DateTime.Now.ToString("yyyy-MM-dd");
            }
            ViewBag.dt = dt;
            var data = new Service.ImportService().ImANDEx(dt);
            ViewBag.data = data;
            return View();
        }

        public PartialViewResult CompletePartialView() {

            var dt = Request["dt"];
            if (string.IsNullOrEmpty(dt)) {
                dt = DateTime.Now.ToString("yyyy-MM-dd");
            }
            ViewBag.dt = dt;
            var data = new Service.ImportService().ImANDEx(dt);
            ViewBag.data = data;

            return PartialView();
        }

   

    }
}
